\(\int (f+g x)^2 (a+b \log (c (d+e x)^n))^2 \, dx\) [45]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 287 \[ \int (f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx=\frac {2 b^2 (e f-d g)^2 n^2 x}{e^2}+\frac {b^2 g (e f-d g) n^2 (d+e x)^2}{2 e^3}+\frac {2 b^2 g^2 n^2 (d+e x)^3}{27 e^3}+\frac {b^2 (e f-d g)^3 n^2 \log ^2(d+e x)}{3 e^3 g}-\frac {2 b (e f-d g)^2 n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {b g (e f-d g) n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {2 b g^2 n (d+e x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{9 e^3}-\frac {2 b (e f-d g)^3 n \log (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 e^3 g}+\frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{3 g} \]

[Out]

2*b^2*(-d*g+e*f)^2*n^2*x/e^2+1/2*b^2*g*(-d*g+e*f)*n^2*(e*x+d)^2/e^3+2/27*b^2*g^2*n^2*(e*x+d)^3/e^3+1/3*b^2*(-d
*g+e*f)^3*n^2*ln(e*x+d)^2/e^3/g-2*b*(-d*g+e*f)^2*n*(e*x+d)*(a+b*ln(c*(e*x+d)^n))/e^3-b*g*(-d*g+e*f)*n*(e*x+d)^
2*(a+b*ln(c*(e*x+d)^n))/e^3-2/9*b*g^2*n*(e*x+d)^3*(a+b*ln(c*(e*x+d)^n))/e^3-2/3*b*(-d*g+e*f)^3*n*ln(e*x+d)*(a+
b*ln(c*(e*x+d)^n))/e^3/g+1/3*(g*x+f)^3*(a+b*ln(c*(e*x+d)^n))^2/g

Rubi [A] (verified)

Time = 0.27 (sec) , antiderivative size = 287, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.292, Rules used = {2445, 2458, 45, 2372, 12, 14, 2338} \[ \int (f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx=-\frac {2 b n (e f-d g)^3 \log (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 e^3 g}-\frac {2 b n (d+e x) (e f-d g)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {b g n (d+e x)^2 (e f-d g) \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {2 b g^2 n (d+e x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{9 e^3}+\frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{3 g}+\frac {b^2 g n^2 (d+e x)^2 (e f-d g)}{2 e^3}+\frac {b^2 n^2 (e f-d g)^3 \log ^2(d+e x)}{3 e^3 g}+\frac {2 b^2 g^2 n^2 (d+e x)^3}{27 e^3}+\frac {2 b^2 n^2 x (e f-d g)^2}{e^2} \]

[In]

Int[(f + g*x)^2*(a + b*Log[c*(d + e*x)^n])^2,x]

[Out]

(2*b^2*(e*f - d*g)^2*n^2*x)/e^2 + (b^2*g*(e*f - d*g)*n^2*(d + e*x)^2)/(2*e^3) + (2*b^2*g^2*n^2*(d + e*x)^3)/(2
7*e^3) + (b^2*(e*f - d*g)^3*n^2*Log[d + e*x]^2)/(3*e^3*g) - (2*b*(e*f - d*g)^2*n*(d + e*x)*(a + b*Log[c*(d + e
*x)^n]))/e^3 - (b*g*(e*f - d*g)*n*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n]))/e^3 - (2*b*g^2*n*(d + e*x)^3*(a + b*
Log[c*(d + e*x)^n]))/(9*e^3) - (2*b*(e*f - d*g)^3*n*Log[d + e*x]*(a + b*Log[c*(d + e*x)^n]))/(3*e^3*g) + ((f +
 g*x)^3*(a + b*Log[c*(d + e*x)^n])^2)/(3*g)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2372

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Dist[a + b*Log[c*x^n], u, x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]]
 /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 2445

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f
 + g*x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])^p/(g*(q + 1))), x] - Dist[b*e*n*(p/(g*(q + 1))), Int[(f + g*x)^(q
+ 1)*((a + b*Log[c*(d + e*x)^n])^(p - 1)/(d + e*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*
f - d*g, 0] && GtQ[p, 0] && NeQ[q, -1] && IntegersQ[2*p, 2*q] && ( !IGtQ[q, 0] || (EqQ[p, 2] && NeQ[q, 1]))

Rule 2458

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))
^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[(g*(x/e))^q*((e*h - d*i)/e + i*(x/e))^r*(a + b*Log[c*x^n])^p, x], x,
d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - d*g, 0] && (IGtQ[p, 0] || IGtQ[
r, 0]) && IntegerQ[2*r]

Rubi steps \begin{align*} \text {integral}& = \frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{3 g}-\frac {(2 b e n) \int \frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{d+e x} \, dx}{3 g} \\ & = \frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{3 g}-\frac {(2 b n) \text {Subst}\left (\int \frac {\left (\frac {e f-d g}{e}+\frac {g x}{e}\right )^3 \left (a+b \log \left (c x^n\right )\right )}{x} \, dx,x,d+e x\right )}{3 g} \\ & = -\frac {2 b (e f-d g)^2 n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {b g (e f-d g) n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {2 b g^2 n (d+e x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{9 e^3}-\frac {2 b (e f-d g)^3 n \log (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 e^3 g}+\frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{3 g}+\frac {\left (2 b^2 n^2\right ) \text {Subst}\left (\int \frac {g x \left (18 e^2 f^2+9 e f g (-4 d+x)+g^2 \left (18 d^2-9 d x+2 x^2\right )\right )+6 (e f-d g)^3 \log (x)}{6 e^3 x} \, dx,x,d+e x\right )}{3 g} \\ & = -\frac {2 b (e f-d g)^2 n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {b g (e f-d g) n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {2 b g^2 n (d+e x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{9 e^3}-\frac {2 b (e f-d g)^3 n \log (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 e^3 g}+\frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{3 g}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \frac {g x \left (18 e^2 f^2+9 e f g (-4 d+x)+g^2 \left (18 d^2-9 d x+2 x^2\right )\right )+6 (e f-d g)^3 \log (x)}{x} \, dx,x,d+e x\right )}{9 e^3 g} \\ & = -\frac {2 b (e f-d g)^2 n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {b g (e f-d g) n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {2 b g^2 n (d+e x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{9 e^3}-\frac {2 b (e f-d g)^3 n \log (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 e^3 g}+\frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{3 g}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \left (g \left (18 (e f-d g)^2+9 g (e f-d g) x+2 g^2 x^2\right )+\frac {6 (e f-d g)^3 \log (x)}{x}\right ) \, dx,x,d+e x\right )}{9 e^3 g} \\ & = -\frac {2 b (e f-d g)^2 n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {b g (e f-d g) n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {2 b g^2 n (d+e x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{9 e^3}-\frac {2 b (e f-d g)^3 n \log (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 e^3 g}+\frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{3 g}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \left (18 (e f-d g)^2+9 g (e f-d g) x+2 g^2 x^2\right ) \, dx,x,d+e x\right )}{9 e^3}+\frac {\left (2 b^2 (e f-d g)^3 n^2\right ) \text {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,d+e x\right )}{3 e^3 g} \\ & = \frac {2 b^2 (e f-d g)^2 n^2 x}{e^2}+\frac {b^2 g (e f-d g) n^2 (d+e x)^2}{2 e^3}+\frac {2 b^2 g^2 n^2 (d+e x)^3}{27 e^3}+\frac {b^2 (e f-d g)^3 n^2 \log ^2(d+e x)}{3 e^3 g}-\frac {2 b (e f-d g)^2 n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {b g (e f-d g) n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{e^3}-\frac {2 b g^2 n (d+e x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{9 e^3}-\frac {2 b (e f-d g)^3 n \log (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 e^3 g}+\frac {(f+g x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{3 g} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 247, normalized size of antiderivative = 0.86 \[ \int (f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx=\frac {54 (e f-d g)^2 (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2+54 g (e f-d g) (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2+18 g^2 (d+e x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2-108 b (e f-d g)^2 n \left (e (a-b n) x+b (d+e x) \log \left (c (d+e x)^n\right )\right )+27 b g (e f-d g) n \left (b e n x (2 d+e x)-2 (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )\right )+4 b g^2 n \left (b e n x \left (3 d^2+3 d e x+e^2 x^2\right )-3 (d+e x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )\right )}{54 e^3} \]

[In]

Integrate[(f + g*x)^2*(a + b*Log[c*(d + e*x)^n])^2,x]

[Out]

(54*(e*f - d*g)^2*(d + e*x)*(a + b*Log[c*(d + e*x)^n])^2 + 54*g*(e*f - d*g)*(d + e*x)^2*(a + b*Log[c*(d + e*x)
^n])^2 + 18*g^2*(d + e*x)^3*(a + b*Log[c*(d + e*x)^n])^2 - 108*b*(e*f - d*g)^2*n*(e*(a - b*n)*x + b*(d + e*x)*
Log[c*(d + e*x)^n]) + 27*b*g*(e*f - d*g)*n*(b*e*n*x*(2*d + e*x) - 2*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n])) +
4*b*g^2*n*(b*e*n*x*(3*d^2 + 3*d*e*x + e^2*x^2) - 3*(d + e*x)^3*(a + b*Log[c*(d + e*x)^n])))/(54*e^3)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(849\) vs. \(2(275)=550\).

Time = 1.48 (sec) , antiderivative size = 850, normalized size of antiderivative = 2.96

method result size
parallelrisch \(\frac {108 x^{2} \ln \left (c \left (e x +d \right )^{n}\right ) a b \,e^{3} f g n -108 b^{2} d \,e^{2} f^{2} n^{3}+36 a b \,d^{3} g^{2} n^{2}-54 a^{2} d \,e^{2} f^{2} n +4 x^{3} b^{2} e^{3} g^{2} n^{3}+18 x^{3} a^{2} e^{3} g^{2} n +108 x \,b^{2} e^{3} f^{2} n^{3}+18 \ln \left (c \left (e x +d \right )^{n}\right )^{2} b^{2} d^{3} g^{2} n -66 \ln \left (c \left (e x +d \right )^{n}\right ) b^{2} d^{3} g^{2} n^{2}+54 x \,a^{2} e^{3} f^{2} n +162 b^{2} d^{2} e f g \,n^{3}+108 a b d \,e^{2} f^{2} n^{2}+18 x^{3} \ln \left (c \left (e x +d \right )^{n}\right )^{2} b^{2} e^{3} g^{2} n -12 x^{3} \ln \left (c \left (e x +d \right )^{n}\right ) b^{2} e^{3} g^{2} n^{2}-12 x^{3} a b \,e^{3} g^{2} n^{2}-15 x^{2} b^{2} d \,e^{2} g^{2} n^{3}+27 x^{2} b^{2} e^{3} f g \,n^{3}+54 x \ln \left (c \left (e x +d \right )^{n}\right )^{2} b^{2} e^{3} f^{2} n -108 x \ln \left (c \left (e x +d \right )^{n}\right ) b^{2} e^{3} f^{2} n^{2}+66 x \,b^{2} d^{2} e \,g^{2} n^{3}+108 x \ln \left (c \left (e x +d \right )^{n}\right ) b^{2} d \,e^{2} f g \,n^{2}+108 x a b d \,e^{2} f g \,n^{2}-108 \ln \left (c \left (e x +d \right )^{n}\right ) a b \,d^{2} e f g n +54 x^{2} a^{2} e^{3} f g n -108 x a b \,e^{3} f^{2} n^{2}+54 \ln \left (c \left (e x +d \right )^{n}\right )^{2} b^{2} d \,e^{2} f^{2} n -108 \ln \left (c \left (e x +d \right )^{n}\right ) b^{2} d \,e^{2} f^{2} n^{2}+36 \ln \left (c \left (e x +d \right )^{n}\right ) a b \,d^{3} g^{2} n -66 b^{2} d^{3} g^{2} n^{3}-108 a b \,d^{2} e f g \,n^{2}+36 x^{3} \ln \left (c \left (e x +d \right )^{n}\right ) a b \,e^{3} g^{2} n +54 x^{2} \ln \left (c \left (e x +d \right )^{n}\right )^{2} b^{2} e^{3} f g n +18 x^{2} \ln \left (c \left (e x +d \right )^{n}\right ) b^{2} d \,e^{2} g^{2} n^{2}-54 x^{2} \ln \left (c \left (e x +d \right )^{n}\right ) b^{2} e^{3} f g \,n^{2}+18 x^{2} a b d \,e^{2} g^{2} n^{2}-54 x^{2} a b \,e^{3} f g \,n^{2}-36 x \ln \left (c \left (e x +d \right )^{n}\right ) b^{2} d^{2} e \,g^{2} n^{2}-162 x \,b^{2} d \,e^{2} f g \,n^{3}+108 x \ln \left (c \left (e x +d \right )^{n}\right ) a b \,e^{3} f^{2} n -36 x a b \,d^{2} e \,g^{2} n^{2}-54 \ln \left (c \left (e x +d \right )^{n}\right )^{2} b^{2} d^{2} e f g n +162 \ln \left (c \left (e x +d \right )^{n}\right ) b^{2} d^{2} e f g \,n^{2}+108 \ln \left (c \left (e x +d \right )^{n}\right ) a b d \,e^{2} f^{2} n}{54 n \,e^{3}}\) \(850\)
risch \(\text {Expression too large to display}\) \(4597\)

[In]

int((g*x+f)^2*(a+b*ln(c*(e*x+d)^n))^2,x,method=_RETURNVERBOSE)

[Out]

1/54*(108*x^2*ln(c*(e*x+d)^n)*a*b*e^3*f*g*n-108*b^2*d*e^2*f^2*n^3+36*a*b*d^3*g^2*n^2-54*a^2*d*e^2*f^2*n+4*x^3*
b^2*e^3*g^2*n^3+18*x^3*a^2*e^3*g^2*n+108*x*b^2*e^3*f^2*n^3+18*ln(c*(e*x+d)^n)^2*b^2*d^3*g^2*n-66*ln(c*(e*x+d)^
n)*b^2*d^3*g^2*n^2+54*x*a^2*e^3*f^2*n+162*b^2*d^2*e*f*g*n^3+108*a*b*d*e^2*f^2*n^2+18*x^3*ln(c*(e*x+d)^n)^2*b^2
*e^3*g^2*n-12*x^3*ln(c*(e*x+d)^n)*b^2*e^3*g^2*n^2-12*x^3*a*b*e^3*g^2*n^2-15*x^2*b^2*d*e^2*g^2*n^3+27*x^2*b^2*e
^3*f*g*n^3+54*x*ln(c*(e*x+d)^n)^2*b^2*e^3*f^2*n-108*x*ln(c*(e*x+d)^n)*b^2*e^3*f^2*n^2+66*x*b^2*d^2*e*g^2*n^3+1
08*x*ln(c*(e*x+d)^n)*b^2*d*e^2*f*g*n^2+108*x*a*b*d*e^2*f*g*n^2-108*ln(c*(e*x+d)^n)*a*b*d^2*e*f*g*n+54*x^2*a^2*
e^3*f*g*n-108*x*a*b*e^3*f^2*n^2+54*ln(c*(e*x+d)^n)^2*b^2*d*e^2*f^2*n-108*ln(c*(e*x+d)^n)*b^2*d*e^2*f^2*n^2+36*
ln(c*(e*x+d)^n)*a*b*d^3*g^2*n-66*b^2*d^3*g^2*n^3-108*a*b*d^2*e*f*g*n^2+36*x^3*ln(c*(e*x+d)^n)*a*b*e^3*g^2*n+54
*x^2*ln(c*(e*x+d)^n)^2*b^2*e^3*f*g*n+18*x^2*ln(c*(e*x+d)^n)*b^2*d*e^2*g^2*n^2-54*x^2*ln(c*(e*x+d)^n)*b^2*e^3*f
*g*n^2+18*x^2*a*b*d*e^2*g^2*n^2-54*x^2*a*b*e^3*f*g*n^2-36*x*ln(c*(e*x+d)^n)*b^2*d^2*e*g^2*n^2-162*x*b^2*d*e^2*
f*g*n^3+108*x*ln(c*(e*x+d)^n)*a*b*e^3*f^2*n-36*x*a*b*d^2*e*g^2*n^2-54*ln(c*(e*x+d)^n)^2*b^2*d^2*e*f*g*n+162*ln
(c*(e*x+d)^n)*b^2*d^2*e*f*g*n^2+108*ln(c*(e*x+d)^n)*a*b*d*e^2*f^2*n)/n/e^3

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 760 vs. \(2 (275) = 550\).

Time = 0.30 (sec) , antiderivative size = 760, normalized size of antiderivative = 2.65 \[ \int (f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx=\frac {2 \, {\left (2 \, b^{2} e^{3} g^{2} n^{2} - 6 \, a b e^{3} g^{2} n + 9 \, a^{2} e^{3} g^{2}\right )} x^{3} + 3 \, {\left (18 \, a^{2} e^{3} f g + {\left (9 \, b^{2} e^{3} f g - 5 \, b^{2} d e^{2} g^{2}\right )} n^{2} - 6 \, {\left (3 \, a b e^{3} f g - a b d e^{2} g^{2}\right )} n\right )} x^{2} + 18 \, {\left (b^{2} e^{3} g^{2} n^{2} x^{3} + 3 \, b^{2} e^{3} f g n^{2} x^{2} + 3 \, b^{2} e^{3} f^{2} n^{2} x + {\left (3 \, b^{2} d e^{2} f^{2} - 3 \, b^{2} d^{2} e f g + b^{2} d^{3} g^{2}\right )} n^{2}\right )} \log \left (e x + d\right )^{2} + 18 \, {\left (b^{2} e^{3} g^{2} x^{3} + 3 \, b^{2} e^{3} f g x^{2} + 3 \, b^{2} e^{3} f^{2} x\right )} \log \left (c\right )^{2} + 6 \, {\left (9 \, a^{2} e^{3} f^{2} + {\left (18 \, b^{2} e^{3} f^{2} - 27 \, b^{2} d e^{2} f g + 11 \, b^{2} d^{2} e g^{2}\right )} n^{2} - 6 \, {\left (3 \, a b e^{3} f^{2} - 3 \, a b d e^{2} f g + a b d^{2} e g^{2}\right )} n\right )} x - 6 \, {\left (2 \, {\left (b^{2} e^{3} g^{2} n^{2} - 3 \, a b e^{3} g^{2} n\right )} x^{3} + {\left (18 \, b^{2} d e^{2} f^{2} - 27 \, b^{2} d^{2} e f g + 11 \, b^{2} d^{3} g^{2}\right )} n^{2} - 3 \, {\left (6 \, a b e^{3} f g n - {\left (3 \, b^{2} e^{3} f g - b^{2} d e^{2} g^{2}\right )} n^{2}\right )} x^{2} - 6 \, {\left (3 \, a b d e^{2} f^{2} - 3 \, a b d^{2} e f g + a b d^{3} g^{2}\right )} n - 6 \, {\left (3 \, a b e^{3} f^{2} n - {\left (3 \, b^{2} e^{3} f^{2} - 3 \, b^{2} d e^{2} f g + b^{2} d^{2} e g^{2}\right )} n^{2}\right )} x - 6 \, {\left (b^{2} e^{3} g^{2} n x^{3} + 3 \, b^{2} e^{3} f g n x^{2} + 3 \, b^{2} e^{3} f^{2} n x + {\left (3 \, b^{2} d e^{2} f^{2} - 3 \, b^{2} d^{2} e f g + b^{2} d^{3} g^{2}\right )} n\right )} \log \left (c\right )\right )} \log \left (e x + d\right ) - 6 \, {\left (2 \, {\left (b^{2} e^{3} g^{2} n - 3 \, a b e^{3} g^{2}\right )} x^{3} - 3 \, {\left (6 \, a b e^{3} f g - {\left (3 \, b^{2} e^{3} f g - b^{2} d e^{2} g^{2}\right )} n\right )} x^{2} - 6 \, {\left (3 \, a b e^{3} f^{2} - {\left (3 \, b^{2} e^{3} f^{2} - 3 \, b^{2} d e^{2} f g + b^{2} d^{2} e g^{2}\right )} n\right )} x\right )} \log \left (c\right )}{54 \, e^{3}} \]

[In]

integrate((g*x+f)^2*(a+b*log(c*(e*x+d)^n))^2,x, algorithm="fricas")

[Out]

1/54*(2*(2*b^2*e^3*g^2*n^2 - 6*a*b*e^3*g^2*n + 9*a^2*e^3*g^2)*x^3 + 3*(18*a^2*e^3*f*g + (9*b^2*e^3*f*g - 5*b^2
*d*e^2*g^2)*n^2 - 6*(3*a*b*e^3*f*g - a*b*d*e^2*g^2)*n)*x^2 + 18*(b^2*e^3*g^2*n^2*x^3 + 3*b^2*e^3*f*g*n^2*x^2 +
 3*b^2*e^3*f^2*n^2*x + (3*b^2*d*e^2*f^2 - 3*b^2*d^2*e*f*g + b^2*d^3*g^2)*n^2)*log(e*x + d)^2 + 18*(b^2*e^3*g^2
*x^3 + 3*b^2*e^3*f*g*x^2 + 3*b^2*e^3*f^2*x)*log(c)^2 + 6*(9*a^2*e^3*f^2 + (18*b^2*e^3*f^2 - 27*b^2*d*e^2*f*g +
 11*b^2*d^2*e*g^2)*n^2 - 6*(3*a*b*e^3*f^2 - 3*a*b*d*e^2*f*g + a*b*d^2*e*g^2)*n)*x - 6*(2*(b^2*e^3*g^2*n^2 - 3*
a*b*e^3*g^2*n)*x^3 + (18*b^2*d*e^2*f^2 - 27*b^2*d^2*e*f*g + 11*b^2*d^3*g^2)*n^2 - 3*(6*a*b*e^3*f*g*n - (3*b^2*
e^3*f*g - b^2*d*e^2*g^2)*n^2)*x^2 - 6*(3*a*b*d*e^2*f^2 - 3*a*b*d^2*e*f*g + a*b*d^3*g^2)*n - 6*(3*a*b*e^3*f^2*n
 - (3*b^2*e^3*f^2 - 3*b^2*d*e^2*f*g + b^2*d^2*e*g^2)*n^2)*x - 6*(b^2*e^3*g^2*n*x^3 + 3*b^2*e^3*f*g*n*x^2 + 3*b
^2*e^3*f^2*n*x + (3*b^2*d*e^2*f^2 - 3*b^2*d^2*e*f*g + b^2*d^3*g^2)*n)*log(c))*log(e*x + d) - 6*(2*(b^2*e^3*g^2
*n - 3*a*b*e^3*g^2)*x^3 - 3*(6*a*b*e^3*f*g - (3*b^2*e^3*f*g - b^2*d*e^2*g^2)*n)*x^2 - 6*(3*a*b*e^3*f^2 - (3*b^
2*e^3*f^2 - 3*b^2*d*e^2*f*g + b^2*d^2*e*g^2)*n)*x)*log(c))/e^3

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 774 vs. \(2 (274) = 548\).

Time = 1.23 (sec) , antiderivative size = 774, normalized size of antiderivative = 2.70 \[ \int (f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx=\begin {cases} a^{2} f^{2} x + a^{2} f g x^{2} + \frac {a^{2} g^{2} x^{3}}{3} + \frac {2 a b d^{3} g^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e^{3}} - \frac {2 a b d^{2} f g \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{2}} - \frac {2 a b d^{2} g^{2} n x}{3 e^{2}} + \frac {2 a b d f^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{e} + \frac {2 a b d f g n x}{e} + \frac {a b d g^{2} n x^{2}}{3 e} - 2 a b f^{2} n x + 2 a b f^{2} x \log {\left (c \left (d + e x\right )^{n} \right )} - a b f g n x^{2} + 2 a b f g x^{2} \log {\left (c \left (d + e x\right )^{n} \right )} - \frac {2 a b g^{2} n x^{3}}{9} + \frac {2 a b g^{2} x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{3} - \frac {11 b^{2} d^{3} g^{2} n \log {\left (c \left (d + e x\right )^{n} \right )}}{9 e^{3}} + \frac {b^{2} d^{3} g^{2} \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{3 e^{3}} + \frac {3 b^{2} d^{2} f g n \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{2}} - \frac {b^{2} d^{2} f g \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{e^{2}} + \frac {11 b^{2} d^{2} g^{2} n^{2} x}{9 e^{2}} - \frac {2 b^{2} d^{2} g^{2} n x \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e^{2}} - \frac {2 b^{2} d f^{2} n \log {\left (c \left (d + e x\right )^{n} \right )}}{e} + \frac {b^{2} d f^{2} \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{e} - \frac {3 b^{2} d f g n^{2} x}{e} + \frac {2 b^{2} d f g n x \log {\left (c \left (d + e x\right )^{n} \right )}}{e} - \frac {5 b^{2} d g^{2} n^{2} x^{2}}{18 e} + \frac {b^{2} d g^{2} n x^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e} + 2 b^{2} f^{2} n^{2} x - 2 b^{2} f^{2} n x \log {\left (c \left (d + e x\right )^{n} \right )} + b^{2} f^{2} x \log {\left (c \left (d + e x\right )^{n} \right )}^{2} + \frac {b^{2} f g n^{2} x^{2}}{2} - b^{2} f g n x^{2} \log {\left (c \left (d + e x\right )^{n} \right )} + b^{2} f g x^{2} \log {\left (c \left (d + e x\right )^{n} \right )}^{2} + \frac {2 b^{2} g^{2} n^{2} x^{3}}{27} - \frac {2 b^{2} g^{2} n x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{9} + \frac {b^{2} g^{2} x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{3} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right )^{2} \left (f^{2} x + f g x^{2} + \frac {g^{2} x^{3}}{3}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate((g*x+f)**2*(a+b*ln(c*(e*x+d)**n))**2,x)

[Out]

Piecewise((a**2*f**2*x + a**2*f*g*x**2 + a**2*g**2*x**3/3 + 2*a*b*d**3*g**2*log(c*(d + e*x)**n)/(3*e**3) - 2*a
*b*d**2*f*g*log(c*(d + e*x)**n)/e**2 - 2*a*b*d**2*g**2*n*x/(3*e**2) + 2*a*b*d*f**2*log(c*(d + e*x)**n)/e + 2*a
*b*d*f*g*n*x/e + a*b*d*g**2*n*x**2/(3*e) - 2*a*b*f**2*n*x + 2*a*b*f**2*x*log(c*(d + e*x)**n) - a*b*f*g*n*x**2
+ 2*a*b*f*g*x**2*log(c*(d + e*x)**n) - 2*a*b*g**2*n*x**3/9 + 2*a*b*g**2*x**3*log(c*(d + e*x)**n)/3 - 11*b**2*d
**3*g**2*n*log(c*(d + e*x)**n)/(9*e**3) + b**2*d**3*g**2*log(c*(d + e*x)**n)**2/(3*e**3) + 3*b**2*d**2*f*g*n*l
og(c*(d + e*x)**n)/e**2 - b**2*d**2*f*g*log(c*(d + e*x)**n)**2/e**2 + 11*b**2*d**2*g**2*n**2*x/(9*e**2) - 2*b*
*2*d**2*g**2*n*x*log(c*(d + e*x)**n)/(3*e**2) - 2*b**2*d*f**2*n*log(c*(d + e*x)**n)/e + b**2*d*f**2*log(c*(d +
 e*x)**n)**2/e - 3*b**2*d*f*g*n**2*x/e + 2*b**2*d*f*g*n*x*log(c*(d + e*x)**n)/e - 5*b**2*d*g**2*n**2*x**2/(18*
e) + b**2*d*g**2*n*x**2*log(c*(d + e*x)**n)/(3*e) + 2*b**2*f**2*n**2*x - 2*b**2*f**2*n*x*log(c*(d + e*x)**n) +
 b**2*f**2*x*log(c*(d + e*x)**n)**2 + b**2*f*g*n**2*x**2/2 - b**2*f*g*n*x**2*log(c*(d + e*x)**n) + b**2*f*g*x*
*2*log(c*(d + e*x)**n)**2 + 2*b**2*g**2*n**2*x**3/27 - 2*b**2*g**2*n*x**3*log(c*(d + e*x)**n)/9 + b**2*g**2*x*
*3*log(c*(d + e*x)**n)**2/3, Ne(e, 0)), ((a + b*log(c*d**n))**2*(f**2*x + f*g*x**2 + g**2*x**3/3), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 554 vs. \(2 (275) = 550\).

Time = 0.21 (sec) , antiderivative size = 554, normalized size of antiderivative = 1.93 \[ \int (f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx=\frac {1}{3} \, b^{2} g^{2} x^{3} \log \left ({\left (e x + d\right )}^{n} c\right )^{2} + \frac {2}{3} \, a b g^{2} x^{3} \log \left ({\left (e x + d\right )}^{n} c\right ) + b^{2} f g x^{2} \log \left ({\left (e x + d\right )}^{n} c\right )^{2} + \frac {1}{3} \, a^{2} g^{2} x^{3} - 2 \, a b e f^{2} n {\left (\frac {x}{e} - \frac {d \log \left (e x + d\right )}{e^{2}}\right )} + \frac {1}{9} \, a b e g^{2} n {\left (\frac {6 \, d^{3} \log \left (e x + d\right )}{e^{4}} - \frac {2 \, e^{2} x^{3} - 3 \, d e x^{2} + 6 \, d^{2} x}{e^{3}}\right )} - a b e f g n {\left (\frac {2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac {e x^{2} - 2 \, d x}{e^{2}}\right )} + 2 \, a b f g x^{2} \log \left ({\left (e x + d\right )}^{n} c\right ) + b^{2} f^{2} x \log \left ({\left (e x + d\right )}^{n} c\right )^{2} + a^{2} f g x^{2} + 2 \, a b f^{2} x \log \left ({\left (e x + d\right )}^{n} c\right ) - {\left (2 \, e n {\left (\frac {x}{e} - \frac {d \log \left (e x + d\right )}{e^{2}}\right )} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac {{\left (d \log \left (e x + d\right )^{2} - 2 \, e x + 2 \, d \log \left (e x + d\right )\right )} n^{2}}{e}\right )} b^{2} f^{2} - \frac {1}{2} \, {\left (2 \, e n {\left (\frac {2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac {e x^{2} - 2 \, d x}{e^{2}}\right )} \log \left ({\left (e x + d\right )}^{n} c\right ) - \frac {{\left (e^{2} x^{2} + 2 \, d^{2} \log \left (e x + d\right )^{2} - 6 \, d e x + 6 \, d^{2} \log \left (e x + d\right )\right )} n^{2}}{e^{2}}\right )} b^{2} f g + \frac {1}{54} \, {\left (6 \, e n {\left (\frac {6 \, d^{3} \log \left (e x + d\right )}{e^{4}} - \frac {2 \, e^{2} x^{3} - 3 \, d e x^{2} + 6 \, d^{2} x}{e^{3}}\right )} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac {{\left (4 \, e^{3} x^{3} - 15 \, d e^{2} x^{2} - 18 \, d^{3} \log \left (e x + d\right )^{2} + 66 \, d^{2} e x - 66 \, d^{3} \log \left (e x + d\right )\right )} n^{2}}{e^{3}}\right )} b^{2} g^{2} + a^{2} f^{2} x \]

[In]

integrate((g*x+f)^2*(a+b*log(c*(e*x+d)^n))^2,x, algorithm="maxima")

[Out]

1/3*b^2*g^2*x^3*log((e*x + d)^n*c)^2 + 2/3*a*b*g^2*x^3*log((e*x + d)^n*c) + b^2*f*g*x^2*log((e*x + d)^n*c)^2 +
 1/3*a^2*g^2*x^3 - 2*a*b*e*f^2*n*(x/e - d*log(e*x + d)/e^2) + 1/9*a*b*e*g^2*n*(6*d^3*log(e*x + d)/e^4 - (2*e^2
*x^3 - 3*d*e*x^2 + 6*d^2*x)/e^3) - a*b*e*f*g*n*(2*d^2*log(e*x + d)/e^3 + (e*x^2 - 2*d*x)/e^2) + 2*a*b*f*g*x^2*
log((e*x + d)^n*c) + b^2*f^2*x*log((e*x + d)^n*c)^2 + a^2*f*g*x^2 + 2*a*b*f^2*x*log((e*x + d)^n*c) - (2*e*n*(x
/e - d*log(e*x + d)/e^2)*log((e*x + d)^n*c) + (d*log(e*x + d)^2 - 2*e*x + 2*d*log(e*x + d))*n^2/e)*b^2*f^2 - 1
/2*(2*e*n*(2*d^2*log(e*x + d)/e^3 + (e*x^2 - 2*d*x)/e^2)*log((e*x + d)^n*c) - (e^2*x^2 + 2*d^2*log(e*x + d)^2
- 6*d*e*x + 6*d^2*log(e*x + d))*n^2/e^2)*b^2*f*g + 1/54*(6*e*n*(6*d^3*log(e*x + d)/e^4 - (2*e^2*x^3 - 3*d*e*x^
2 + 6*d^2*x)/e^3)*log((e*x + d)^n*c) + (4*e^3*x^3 - 15*d*e^2*x^2 - 18*d^3*log(e*x + d)^2 + 66*d^2*e*x - 66*d^3
*log(e*x + d))*n^2/e^3)*b^2*g^2 + a^2*f^2*x

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1315 vs. \(2 (275) = 550\).

Time = 0.41 (sec) , antiderivative size = 1315, normalized size of antiderivative = 4.58 \[ \int (f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx=\text {Too large to display} \]

[In]

integrate((g*x+f)^2*(a+b*log(c*(e*x+d)^n))^2,x, algorithm="giac")

[Out]

(e*x + d)*b^2*f^2*n^2*log(e*x + d)^2/e + (e*x + d)^2*b^2*f*g*n^2*log(e*x + d)^2/e^2 - 2*(e*x + d)*b^2*d*f*g*n^
2*log(e*x + d)^2/e^2 + 1/3*(e*x + d)^3*b^2*g^2*n^2*log(e*x + d)^2/e^3 - (e*x + d)^2*b^2*d*g^2*n^2*log(e*x + d)
^2/e^3 + (e*x + d)*b^2*d^2*g^2*n^2*log(e*x + d)^2/e^3 - 2*(e*x + d)*b^2*f^2*n^2*log(e*x + d)/e - (e*x + d)^2*b
^2*f*g*n^2*log(e*x + d)/e^2 + 4*(e*x + d)*b^2*d*f*g*n^2*log(e*x + d)/e^2 - 2/9*(e*x + d)^3*b^2*g^2*n^2*log(e*x
 + d)/e^3 + (e*x + d)^2*b^2*d*g^2*n^2*log(e*x + d)/e^3 - 2*(e*x + d)*b^2*d^2*g^2*n^2*log(e*x + d)/e^3 + 2*(e*x
 + d)*b^2*f^2*n*log(e*x + d)*log(c)/e + 2*(e*x + d)^2*b^2*f*g*n*log(e*x + d)*log(c)/e^2 - 4*(e*x + d)*b^2*d*f*
g*n*log(e*x + d)*log(c)/e^2 + 2/3*(e*x + d)^3*b^2*g^2*n*log(e*x + d)*log(c)/e^3 - 2*(e*x + d)^2*b^2*d*g^2*n*lo
g(e*x + d)*log(c)/e^3 + 2*(e*x + d)*b^2*d^2*g^2*n*log(e*x + d)*log(c)/e^3 + 2*(e*x + d)*b^2*f^2*n^2/e + 1/2*(e
*x + d)^2*b^2*f*g*n^2/e^2 - 4*(e*x + d)*b^2*d*f*g*n^2/e^2 + 2/27*(e*x + d)^3*b^2*g^2*n^2/e^3 - 1/2*(e*x + d)^2
*b^2*d*g^2*n^2/e^3 + 2*(e*x + d)*b^2*d^2*g^2*n^2/e^3 + 2*(e*x + d)*a*b*f^2*n*log(e*x + d)/e + 2*(e*x + d)^2*a*
b*f*g*n*log(e*x + d)/e^2 - 4*(e*x + d)*a*b*d*f*g*n*log(e*x + d)/e^2 + 2/3*(e*x + d)^3*a*b*g^2*n*log(e*x + d)/e
^3 - 2*(e*x + d)^2*a*b*d*g^2*n*log(e*x + d)/e^3 + 2*(e*x + d)*a*b*d^2*g^2*n*log(e*x + d)/e^3 - 2*(e*x + d)*b^2
*f^2*n*log(c)/e - (e*x + d)^2*b^2*f*g*n*log(c)/e^2 + 4*(e*x + d)*b^2*d*f*g*n*log(c)/e^2 - 2/9*(e*x + d)^3*b^2*
g^2*n*log(c)/e^3 + (e*x + d)^2*b^2*d*g^2*n*log(c)/e^3 - 2*(e*x + d)*b^2*d^2*g^2*n*log(c)/e^3 + (e*x + d)*b^2*f
^2*log(c)^2/e + (e*x + d)^2*b^2*f*g*log(c)^2/e^2 - 2*(e*x + d)*b^2*d*f*g*log(c)^2/e^2 + 1/3*(e*x + d)^3*b^2*g^
2*log(c)^2/e^3 - (e*x + d)^2*b^2*d*g^2*log(c)^2/e^3 + (e*x + d)*b^2*d^2*g^2*log(c)^2/e^3 - 2*(e*x + d)*a*b*f^2
*n/e - (e*x + d)^2*a*b*f*g*n/e^2 + 4*(e*x + d)*a*b*d*f*g*n/e^2 - 2/9*(e*x + d)^3*a*b*g^2*n/e^3 + (e*x + d)^2*a
*b*d*g^2*n/e^3 - 2*(e*x + d)*a*b*d^2*g^2*n/e^3 + 2*(e*x + d)*a*b*f^2*log(c)/e + 2*(e*x + d)^2*a*b*f*g*log(c)/e
^2 - 4*(e*x + d)*a*b*d*f*g*log(c)/e^2 + 2/3*(e*x + d)^3*a*b*g^2*log(c)/e^3 - 2*(e*x + d)^2*a*b*d*g^2*log(c)/e^
3 + 2*(e*x + d)*a*b*d^2*g^2*log(c)/e^3 + (e*x + d)*a^2*f^2/e + (e*x + d)^2*a^2*f*g/e^2 - 2*(e*x + d)*a^2*d*f*g
/e^2 + 1/3*(e*x + d)^3*a^2*g^2/e^3 - (e*x + d)^2*a^2*d*g^2/e^3 + (e*x + d)*a^2*d^2*g^2/e^3

Mupad [B] (verification not implemented)

Time = 0.96 (sec) , antiderivative size = 591, normalized size of antiderivative = 2.06 \[ \int (f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx=\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {x^2\,\left (\frac {3\,b\,g\,\left (a\,d\,g+2\,a\,e\,f-b\,e\,f\,n\right )}{e}-\frac {b\,d\,g^2\,\left (3\,a-b\,n\right )}{e}\right )}{3}-\frac {x\,\left (\frac {d\,\left (\frac {18\,b\,g\,\left (a\,d\,g+2\,a\,e\,f-b\,e\,f\,n\right )}{e}-\frac {6\,b\,d\,g^2\,\left (3\,a-b\,n\right )}{e}\right )}{3\,e}-\frac {6\,b\,f\,\left (2\,a\,d\,g+a\,e\,f-b\,e\,f\,n\right )}{e}\right )}{3}+\frac {2\,b\,g^2\,x^3\,\left (3\,a-b\,n\right )}{9}\right )+x\,\left (\frac {18\,a^2\,d\,e\,f\,g+9\,a^2\,e^2\,f^2-18\,a\,b\,e^2\,f^2\,n+6\,b^2\,d^2\,g^2\,n^2-18\,b^2\,d\,e\,f\,g\,n^2+18\,b^2\,e^2\,f^2\,n^2}{9\,e^2}-\frac {d\,\left (\frac {g\,\left (3\,a^2\,d\,g+6\,a^2\,e\,f-b^2\,d\,g\,n^2+3\,b^2\,e\,f\,n^2-6\,a\,b\,e\,f\,n\right )}{3\,e}-\frac {d\,g^2\,\left (9\,a^2-6\,a\,b\,n+2\,b^2\,n^2\right )}{9\,e}\right )}{e}\right )+x^2\,\left (\frac {g\,\left (3\,a^2\,d\,g+6\,a^2\,e\,f-b^2\,d\,g\,n^2+3\,b^2\,e\,f\,n^2-6\,a\,b\,e\,f\,n\right )}{6\,e}-\frac {d\,g^2\,\left (9\,a^2-6\,a\,b\,n+2\,b^2\,n^2\right )}{18\,e}\right )+{\ln \left (c\,{\left (d+e\,x\right )}^n\right )}^2\,\left (b^2\,f^2\,x+\frac {b^2\,g^2\,x^3}{3}+\frac {d\,\left (b^2\,d^2\,g^2-3\,b^2\,d\,e\,f\,g+3\,b^2\,e^2\,f^2\right )}{3\,e^3}+b^2\,f\,g\,x^2\right )-\frac {\ln \left (d+e\,x\right )\,\left (11\,b^2\,d^3\,g^2\,n^2-27\,b^2\,d^2\,e\,f\,g\,n^2+18\,b^2\,d\,e^2\,f^2\,n^2-6\,a\,b\,d^3\,g^2\,n+18\,a\,b\,d^2\,e\,f\,g\,n-18\,a\,b\,d\,e^2\,f^2\,n\right )}{9\,e^3}+\frac {g^2\,x^3\,\left (9\,a^2-6\,a\,b\,n+2\,b^2\,n^2\right )}{27} \]

[In]

int((f + g*x)^2*(a + b*log(c*(d + e*x)^n))^2,x)

[Out]

log(c*(d + e*x)^n)*((x^2*((3*b*g*(a*d*g + 2*a*e*f - b*e*f*n))/e - (b*d*g^2*(3*a - b*n))/e))/3 - (x*((d*((18*b*
g*(a*d*g + 2*a*e*f - b*e*f*n))/e - (6*b*d*g^2*(3*a - b*n))/e))/(3*e) - (6*b*f*(2*a*d*g + a*e*f - b*e*f*n))/e))
/3 + (2*b*g^2*x^3*(3*a - b*n))/9) + x*((9*a^2*e^2*f^2 + 6*b^2*d^2*g^2*n^2 + 18*b^2*e^2*f^2*n^2 - 18*a*b*e^2*f^
2*n + 18*a^2*d*e*f*g - 18*b^2*d*e*f*g*n^2)/(9*e^2) - (d*((g*(3*a^2*d*g + 6*a^2*e*f - b^2*d*g*n^2 + 3*b^2*e*f*n
^2 - 6*a*b*e*f*n))/(3*e) - (d*g^2*(9*a^2 + 2*b^2*n^2 - 6*a*b*n))/(9*e)))/e) + x^2*((g*(3*a^2*d*g + 6*a^2*e*f -
 b^2*d*g*n^2 + 3*b^2*e*f*n^2 - 6*a*b*e*f*n))/(6*e) - (d*g^2*(9*a^2 + 2*b^2*n^2 - 6*a*b*n))/(18*e)) + log(c*(d
+ e*x)^n)^2*(b^2*f^2*x + (b^2*g^2*x^3)/3 + (d*(b^2*d^2*g^2 + 3*b^2*e^2*f^2 - 3*b^2*d*e*f*g))/(3*e^3) + b^2*f*g
*x^2) - (log(d + e*x)*(11*b^2*d^3*g^2*n^2 - 6*a*b*d^3*g^2*n + 18*b^2*d*e^2*f^2*n^2 - 18*a*b*d*e^2*f^2*n - 27*b
^2*d^2*e*f*g*n^2 + 18*a*b*d^2*e*f*g*n))/(9*e^3) + (g^2*x^3*(9*a^2 + 2*b^2*n^2 - 6*a*b*n))/27